home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-02-08 | 2.4 KB | 87 lines | [TEXT/MPS ] |
- /*
- * File Cookie.r
- *
- * Copyright Apple Computer, Inc. 1985-1987
- * All rights reserved.
- *
- * Sample desk accessory resource file.
- * This incorporates the DRVR header information (defined here)
- * with the linked code (stored as a 'DRVW' resource in the link command)
- */
-
- #include "Types.r" /* To get system types */
- #include "MPWTypes.r" /* To get 'DRVW' type */
-
- type 'DRVR' as 'DRVW'; /* Map 'DRVW' => 'DRVR' */
-
- /*
- * This will produce a DRVR resource from the special DRVW type.
- *
- * Note that the ID 12 is irrelevant, since the Font/DA Mover
- * will renumber it to something else when installing it anyway.
- *
- * The leading NUL in the resource name is required to
- * conform to the desk accessory naming convention.
- *
- * The resource is declared purgeable. If the code were to
- * do funky things like SetTrapAddress calls (requiring the code to
- * be around at all times), we would have to set it nonpurgeable.
- */
-
- #define DriverID 12
-
- resource 'DRVR' (DriverID, "\0x00Cookie", purgeable) {
- /*
- * DRVR flags
- */
- dontNeedLock, /* OK to float around, not saving ProcPtrs */
- dontNeedTime, /* Yes, give us periodic Control calls */
- needGoodbye, /* No special requirements */
- noStatusEnable,
- ctlEnable, /* Desk accessories only do Control calls */
- noWriteEnable,
- noReadEnable,
- 0, /* drvrDelay - Wake up every 5 seconds */
- mDownMask + updateMask + keyDownMask + autoKeyMask,
- 0, /* drvrMenu - This DA has no menu */
- "Cookie", /* drvrName - This isn't used by the DA */
- /*
- * This directive inserts the contents of the DRVW resource
- * produced by linking DRVRRuntime.o with our DA code
- */
- $$resource("Cookie.DRVW", 'DRVW', 0)
- };
-
- /*
- * Since desk accessories cannot use global data (and the C compiler
- * considers string constants to be global data) and we really don't
- * want to hard-code strings in our source, the strings used by the
- * DA are stored in the resource file. Note the expression used to
- * figure out the resource id.
- */
-
- resource 'STR#' (0xC000 | (DriverID << 5), "Cookie's Strings") {
- {
- "Fortunes"
- };
- };
-
-
- resource 'WIND' (0xC000 | (DriverID << 5), "Cookie's Window") {
- {0, 0, 0, 0},
- documentProc,
- invisible,
- goAway,
- 0x0,
- "Fortune Cookie"
- };
-
-
- /* Type WhereAt, which puts the window where it should be */
- type 'WhAt' {
- rect; /* The position the window was last in */
- };
-
- resource 'WhAt' (0xC000 | (DriverID << 5), "Cookie's WhereAt", purgeable) {
- {100, 5, 238, 395}
- };